using System;
using Ultima.Xna.Diagnostics;
using Ultima.Xna;

namespace Client
{
    static class Program
    {
        static ILoggingService _log = new Logger("Program");
        static ApplicationInfo _applicationInfo;

        public static ApplicationInfo ApplicationInfo
        {
            get { return _applicationInfo; }
            set { _applicationInfo = value; }
        }
        
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
            _applicationInfo = new ApplicationInfo();

            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

            using (Engine game = new Engine())
            {
                game.Run();
            }
        }

        static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            _log.Fatal(e.ExceptionObject);
        }
    }
}

